﻿using System;
using System.Collections.ObjectModel;

namespace WikiDoc
{
    /// <summary>
    /// 
    /// </summary>
    public class ParserCollection : KeyedCollection<string, IParser>
    {
        /// <summary>
        /// 初始化 <see cref="ParserCollection"/> 类的新实例.
        /// </summary>
        public ParserCollection() : base(StringComparer.OrdinalIgnoreCase)
        {
        }

        /// <summary>
        /// 在派生类中实现时，将从指定元素提取键。
        /// </summary>
        /// <param name="item">从中提取键的元素。</param>
        /// <returns>指定元素的键。</returns>
        protected override string GetKeyForItem(IParser item)
        {
            return item.Name;
        }
    }
}
